Pos |
Name |
Points |
Behind |
Weeks |
Min Score |
Max Score |
$query = 'SELECT * , sum( points ) , count( week ) , min( points ) , max( points ) FROM `2015seasontotals` GROUP BY name ORDER BY `sum( points )` DESC ';
$result=mysql_query($query);
$fnum=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $fnum) {
//$st=0;
$p=$i-1;
$spleader=mysql_result($result,0,"sum( points )");
$rname=mysql_result($result,$i,"name");
$points=mysql_result($result,$i,"sum( points )");
$weeks=mysql_result($result,$i, "count( week )");
$min=mysql_result($result,$i, "min( points )");
$max=mysql_result($result,$i, "max( points )");
$pb=mysql_result($result,$p,"sum(points)");
$behind=$spleader-$points;
$extra=1 ;
$pos=$i+$extra ;
?>
echo "$pos"; ?> |
echo "$rname"; ?> |
echo "$points"; ?> |
echo "$behind"; ?> |
echo "$weeks"; ?> |
echo "$min"; ?> |
echo "$max"; ?> |
++$i;
}
echo " ";
?>
|